/**
    ATClab - scriptable Air Traffic Control simulations.
    Copyright (C) 2010 openatclab@gmail.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
**/

#include "routearcsprite.h"
#include "canvas.h"

using namespace atc;

////////////////////////////////////////////////////////////////////////////////
/*!
 * \class atc::RouteArcSprite atc_routearcsprite.h
 * \brief Represents a section of a designated flight route on the Canvas.
 *	
 * Initially all the sections of a route where going to be represented by a 
 * single sprite (atc::RouteSprite) for two reasons :
 *	1] a QCanvasLine based class in integer based
 *	2] want to be able to select all the sections of a route at once
 * Unfortunately QCanvas does not support a polyline and polygons are solid
 * shapes with no outline (due to limitations of QRegion upon which their 
 * implementation depends.
 *	An implementation based on CanvasLine is much easier to implement and
 * the reasons for using a polyline implementation are easily overcome:
 *	1] if the size of the canvas is bigger than the number of screen pixels
 *	   then no additional information is lost by rounding. Also Routes are 
 *	   static for display purposes only so high accuracy not required.
 *	2] by giving each section a pointer to _prev and _next sections a path
 *	   can be found.
 *
 *
 * \todo implement path ie _prev && _next
 */
//-----------------------------------------------------------------------------
//
//

/*!
 * Constructor
 *
 * Adds the sprite to the canvas. The canvas will clean up sprites associated
 * with it in this way ie they take responsibility.
 */
RouteArcSprite::RouteArcSprite( Q3Canvas *c )
	  : Q3CanvasLine( c )
{
	setPen(QPen(Qt::black));
	setZ(-5);
}

/*!
 * Destructor
 */
RouteArcSprite::~RouteArcSprite() {
	hide();
}

//-----------------------------------------------------------------------------
